package com.example.togethermove.adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @ClassName: AppFragmentPageAdapter
 * @Author: csl
 * @Date: 2020/7/31 17:24
 * @Description: viewpageAdapter适配器
 */
//viewpageAdapter适配器
public class AppFragmentPageAdapter extends FragmentPagerAdapter {
    public List<Fragment> mFragmentList;

    public AppFragmentPageAdapter(FragmentManager fm, List<Fragment> fragmentList) {
        super(fm);
        mFragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {

        return mFragmentList == null ? null : mFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mFragmentList == null ? 0 : mFragmentList.size();
    }
}